home *** CD-ROM | disk | FTP | other *** search
/ Apple II Magazines (PO) / Nibble Volume 09, No. 12 (1988-12)(MicroSPARC)(Side A)[a].zip / Nibble Volume 09, No. 12 (1988-12)(MicroSPARC)(Side A)[a].po / TEXT.SHIFTER.S < prev   
Text File  |  1996-12-24  |  1KB  |  39 lines

  1. *
  2. * TEXT.SHIFTER Source Code
  3. * By Steven Meuse
  4. * Copyright(c) 1988
  5. * MicroSPARC, Inc.
  6. * Concord, MA 01742
  7. *
  8.  
  9. T         EQU 0
  10.           ORG $300
  11. *
  12.           LDA $67        ;Get pointers to start of
  13.           STA T          ;Applesoft program, and put
  14.           LDA $68        ;them into our temp pointer.
  15.           STA T+1
  16.           LDY #1         ;Is there a program in memory?
  17.           LDA (T),Y
  18.           BEQ DONE
  19. CHECK     LDY #4         ;4 is the offset to the first
  20. GET       LDA (T),Y      ;byte of this line.
  21.           BEQ NEXTLINE   ;If byte = 0, this line is done.
  22.           BMI NEXTBYTE   ;If hi bit is on, this is a token.
  23.           CMP #$60       ;Check if text is lower case.
  24.           BCC NEXTBYTE   ;No, get another byte.
  25.           AND #$5F       ;Yes, shift it to upper case...
  26.           STA (T),Y      ;...and put it back.
  27. NEXTBYTE  INY            ;Point to next byte.
  28.           BNE GET        ;Always taken.
  29. NEXTLINE  LDY #0         ;Get the pointers to the next line
  30.           LDA (T),Y      ;and put them into temp pointer.
  31.           TAX
  32.           INY
  33.           LDA (T),Y      ;This conditions the Z flag for
  34.           STA T+1        ;the BNE test below.
  35.           STX T
  36.           BNE CHECK      ;A>0 if there are more lines
  37. DONE      RTS
  38.           CHK            ;Merlin CHK code = 9D
  39.